PATH  Mac OS 8 and 9 Developer Documentation > Human Interface Toolbox > Icon Services and Utilities
>
Obtaining and Using Icons With Icon Services

   

RectInIconRef

Tests whether a specified rectangle falls within an icon's mask.

pascal Boolean RectInIconRef(
                     Rect*testRect,
                     Rect*iconRect,
                     IconAlignmentType align,
                     IconServicesUsageFlagsiconServicesUsageFlags,
                     IconReficonRef);

testRect
A pointer to a value of type Rect , specified in local coordinates of the current graphics port. This value specifies the rectangle that Icon Services tests to see whether it falls within the mask of the indicated icon.

iconRect
A pointer to a value of type Rect . This value defines the area that Icon Services uses to determine which icon is hit-tested. Use the same Rect value as when the icon was last drawn.

align
A value of type IconAlignmentType that specifies how the indicated icon is aligned within the rectangle specified in the iconRect parameter. Use the same IconAlignmentType value as when the icon was last drawn. for a description of possible return values, see Icon Alignment Constants .

iconServicesUsageFlags
Reserved for future use. Pass the kIconServicesDefaultUsageFlags constant in this parameter.

iconRef
A pointer to a value of type IconRef specifying the icon family to use for drawing the requested icon.

function result
true if the rectangle specified in the testRect parameter intersects the appropriate icon mask, false otherwise.
DISCUSSION
This function is similar to the Icon Utilities function RectInIconSuite . The function is useful when you want to determine whether a user selection intersects a particular icon, for example. For a description of Icon Utilities functions and data structures, see Inside Macintosh: More Macintosh Toolbox.

Note

Icon Services uses the icon's black-and-white mask for hit-testing, even if you provide a deep mask.


© 1999 Apple Computer, Inc. – (Last Updated 03 Dec 99)